home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / webmon_1 / frmpopup.frm (.txt) < prev    next >
Visual Basic Form  |  1999-08-09  |  12KB  |  292 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPopups 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   3690
  6.    ClientTop       =   2910
  7.    ClientWidth     =   4680
  8.    LinkTopic       =   "Form1"
  9.    MousePointer    =   99  'Custom
  10.    ScaleHeight     =   3195
  11.    ScaleWidth      =   4680
  12.    Begin VB.Timer tmrEnd 
  13.       Enabled         =   0   'False
  14.       Interval        =   3000
  15.       Left            =   1800
  16.       Top             =   1320
  17.    End
  18.    Begin VB.Menu mnuMain 
  19.       Caption         =   "MainWeb"
  20.       Begin VB.Menu mnuPing 
  21.          Caption         =   "Ping Server"
  22.       End
  23.       Begin VB.Menu mnuRemserv 
  24.          Caption         =   "Remove Server"
  25.       End
  26.       Begin VB.Menu mnuEdit 
  27.          Caption         =   "Edit Server Properties.."
  28.       End
  29.       Begin VB.Menu mnuOpenWeb 
  30.          Caption         =   "Open Web Page"
  31.       End
  32.       Begin VB.Menu mnuCritical 
  33.          Caption         =   "Critical"
  34.          Begin VB.Menu mnuReboot 
  35.             Caption         =   "Reboot Server"
  36.          End
  37.          Begin VB.Menu mnuDead 
  38.             Caption         =   "Dead Server"
  39.          End
  40.       End
  41.    End
  42.    Begin VB.Menu mnuQuitMain 
  43.       Caption         =   "SysTray"
  44.       Begin VB.Menu mnuQuit 
  45.          Caption         =   "Quit Application"
  46.       End
  47.       Begin VB.Menu mnuSpeak 
  48.          Caption         =   "Speech"
  49.          Checked         =   -1  'True
  50.       End
  51.       Begin VB.Menu mnuShowLog 
  52.          Caption         =   "..Show Log"
  53.       End
  54.       Begin VB.Menu mnuToggle 
  55.          Caption         =   "Toggle"
  56.          Begin VB.Menu mnuShowGate 
  57.             Caption         =   "Show Gateway"
  58.          End
  59.          Begin VB.Menu mnuShowWeb 
  60.             Caption         =   "Show Web"
  61.          End
  62.          Begin VB.Menu mnuShowpollers 
  63.             Caption         =   "Show Pollers"
  64.          End
  65.       End
  66.    End
  67.    Begin VB.Menu mnuGateMain 
  68.       Caption         =   "MainGateWay"
  69.       Begin VB.Menu mnuGatePing 
  70.          Caption         =   "Ping Server"
  71.       End
  72.       Begin VB.Menu mnuRemGate 
  73.          Caption         =   "Remove Server"
  74.       End
  75.       Begin VB.Menu mnuEditGate 
  76.          Caption         =   "Edit Server Properties"
  77.       End
  78.       Begin VB.Menu mnuCriticalGate 
  79.          Caption         =   "Critical"
  80.          Begin VB.Menu mnuGateReBoot 
  81.             Caption         =   "Re Boot Server"
  82.          End
  83.          Begin VB.Menu mnuGateDie 
  84.             Caption         =   "dead Server"
  85.          End
  86.       End
  87.    End
  88. Attribute VB_Name = "frmPopups"
  89. Attribute VB_GlobalNameSpace = False
  90. Attribute VB_Creatable = False
  91. Attribute VB_PredeclaredId = True
  92. Attribute VB_Exposed = False
  93. Option Explicit
  94. Private Sub mnuDead_Click()
  95.     If blnRebooting(frmMain.intServClicked) = True Then
  96.         RebootPC LSetting("IP" & frmMain.intServClicked), False
  97.         blnRebooting(frmMain.intServClicked) = False
  98.     Else
  99.         If MsgBox("Are you sure you want to Die this server", vbOKCancel) = vbOK Then
  100.             If MsgBox("WARNING!!! This server will not restart and will have to be cycled manually" & vbCrLf & "Are you sure you wish to Die this server?", vbOKCancel) = vbOK Then
  101.                 RebootPC LSetting("IP" & frmMain.intServClicked), True, True
  102.                 blnRebooting(frmMain.intServClicked) = True
  103.                 SayThis "Warning! Killing server " & LSetting("MName" & frmMain.intServClicked) & " This server will not restart"
  104.                 LogIt ("Dead Server " & LSetting("MName" & frmMain.intServClicked) & " This server will not restart")
  105.             End If
  106.         End If
  107.     End If
  108. End Sub
  109. Private Sub mnuEdit_Click()
  110.     blnEdit = True
  111.     frmNewServer.Show
  112. End Sub
  113. Private Sub mnuEditGate_Click()
  114.     blnEdit = True
  115.     frmNewgateWay.Show
  116. End Sub
  117. Private Sub mnuGateDie_Click()
  118.     If blnRebooting(intGateClicked) = True Then
  119.         RebootPC LSetting("GateWayIP" & intGateClicked), False
  120.         blnRebooting(intGateClicked) = False
  121.     Else
  122.         If MsgBox("WARNING!!! This server will not restart and will have to be cycled manually" & vbCrLf & "Are you sure you wish to Die this server?", vbOKCancel) = vbOK Then
  123.                 RebootPC LSetting("gatewayIP" & intGateClicked), True, True
  124.                 blnRebooting(intGateClicked) = True
  125.                 SayThis "Warning! Killing server " & LSetting("GateWayName" & intGateClicked) & " This server will not restart"
  126.             End If
  127.     End If
  128. End Sub
  129. Private Sub mnuGatePing_Click()
  130. Dim ECHO As ICMP_ECHO_REPLY
  131.     FrmGateWay.lblBytesSent = ""
  132.     FrmGateWay.lblBytesRecieved = ""
  133.     FrmGateWay.lblTimeMS = ""
  134.     FrmGateWay.lblPingStatus.Caption = ""
  135.     FrmGateWay.lblPStats2.Caption = ""
  136.     FrmGateWay.lblPingStatus.Caption = "Pinging " & LSetting("GateWayIP" & intGateClicked) & _
  137.                     "with 9 bytes of Data................."
  138.     Call Ping(LSetting("GateWayIP" & intGateClicked), ECHO)
  139.         FrmGateWay.lblBytesSent = "9"
  140.         FrmGateWay.lblBytesRecieved = ECHO.DataSize
  141.         FrmGateWay.lblTimeMS = ECHO.RoundTripTime
  142.         FrmGateWay.lblPingStatus.Caption = GetStatusCode(ECHO.status)
  143.         Select Case Val(GetStatusCode(ECHO.status))
  144.             Case 0
  145.                 FrmGateWay.lblPStats2.Caption = "Successful ping to " & LSetting("GateWayIP" & intGateClicked)
  146.                 SayThis "Pinged the server " & LSetting("GateWayIP" & intGateClicked) & ". The ping was Successful"
  147.             Case Else
  148.                 SayThis "Couldn't Ping the server " & LSetting("IP" & intGateClicked) & ". The ping was UnSuccessful"
  149.                 FrmGateWay.lblPStats2.Caption = "Unable to ping " & LSetting("GateWayIP" & intGateClicked)
  150.         End Select
  151. End Sub
  152. Private Sub mnuGateReBoot_Click()
  153. If blnRebooting(intGateClicked) = True Then
  154.         RebootPC LSetting("GateWayIP" & intGateClicked), False
  155.         blnRebooting(intGateClicked) = False
  156.     Else
  157.         If MsgBox("Are you sure you want to reboot this server", vbOKCancel) = vbOK Then
  158.             RebootPC LSetting("gatewayIP" & intGateClicked), True
  159.             blnRebooting(intGateClicked) = True
  160.             SayThis "Warning! Rebooting server " & LSetting("GateWayName" & intGateClicked)
  161.         End If
  162.     End If
  163. End Sub
  164. Private Sub mnuOpenWeb_Click()
  165. If InStr(1, LSetting("URL" & frmMain.intServClicked), "http://") > 0 Then
  166.     Shell ("start " & LSetting("URL" & frmMain.intServClicked))
  167.     Shell ("start http://" & LSetting("URL" & frmMain.intServClicked))
  168. End If
  169. End Sub
  170. Private Sub mnuPing_Click()
  171.     Dim ECHO As ICMP_ECHO_REPLY
  172.     frmMain.lblBytesSent = ""
  173.     frmMain.lblBytesRecieved = ""
  174.     frmMain.lblTimeMS = ""
  175.     frmMain.lblPingStatus.Caption = ""
  176.     frmMain.lblPStats2.Caption = ""
  177.     frmMain.lblPingStatus.Caption = "Pinging " & LSetting("IP" & frmMain.intServClicked) & _
  178.                     "with 9 bytes of Data................."
  179.     Call Ping(LSetting("IP" & frmMain.intServClicked), ECHO)
  180.         frmMain.lblBytesSent = "9"
  181.         frmMain.lblBytesRecieved = ECHO.DataSize
  182.         frmMain.lblTimeMS = ECHO.RoundTripTime
  183.         frmMain.lblPingStatus.Caption = GetStatusCode(ECHO.status)
  184.         Select Case Val(GetStatusCode(ECHO.status))
  185.             Case 0
  186.                 frmMain.lblPStats2.Caption = "Successful ping to " & LSetting("IP" & frmMain.intServClicked)
  187.                 SayThis "Pinged the server " & LSetting("IP" & frmMain.intServClicked) & ". The ping was Successful"
  188.             Case Else
  189.                 SayThis "Couldn't Ping the server " & LSetting("IP" & frmMain.intServClicked) & ". The ping was UnSuccessful"
  190.                 frmMain.lblPStats2.Caption = "Unable to ping " & LSetting("IP" & frmMain.intServClicked)
  191.         End Select
  192.     End Sub
  193. Private Sub mnuQuit_Click()
  194.     If MsgBox("Are you sure you wish to exit ?", vbOKCancel, "Exit Confirm") = vbOK Then
  195.         FrmExit.Show
  196.         frmMain.inetWeb.Cancel
  197.         Unload frmMain
  198.         Unload FrmGateWay
  199.         tmrEnd.Enabled = True
  200.     End If
  201. End Sub
  202. Private Sub mnuReboot_Click()
  203.     If blnRebooting(frmMain.intServClicked) = True Then
  204.         RebootPC LSetting("IP" & frmMain.intServClicked), False
  205.         blnRebooting(frmMain.intServClicked) = False
  206.         LogIt ("Abort Reboot " & LSetting("MName" & frmMain